home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_12_08
/
plauger
/
isxint.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-06-09
|
344b
|
17 lines
-------------------------- Listing 8: int extractor ---------
// isxint -- istream::operator>>(int&)
#include <limits.h>
#include <istream>
istream& istream::operator>>(int& i)
{ // extract an int
long lo;
*this >> lo;
if (!good() || lo < INT_MIN || INT_MAX < lo)
setstate(failbit);
else
i = lo;
return (*this);
}